<!DOCTYPE html>
<html 
	xmlns="http://www.w3.org/1999/xhtml" 
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui"
	lang="en">

<h:head>
<meta charset="utf-8"></meta>
<title>Academia Fitness Brasil</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
<meta name="description" content=""></meta>
<meta name="author" content=""></meta>

<!-- Le styles -->
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet"></link>
<link href="../bootstrap/js/prettify.css" rel="stylesheet"></link>
<style type="text/css">
body {
	padding-top: 0;
	padding-bottom: 0;
}
body.theme-shellstage {
	background: #000 url(http://i.i.tsatic-cdn.net/takeovers/itm_themes/shellstage.jpg) fixed no-repeat top center;
}
/* Custom container */
.container-narrow {
	margin: 0 auto;
	max-width: 979px;
}
.container-narrow > hr {
	margin: 30px 0;
}
/* Main marketing message and sign up button */
.jumbotron {
	margin: 10px 0;
	text-align: center;
}
.jumbotron h1 {
	font-size: 72px;
	line-height: 1;
}
.jumbotron .btn {
	font-size: 21px;
	padding: 14px 24px;
}
/* Supporting marketing content */
.marketing {
	margin: 0 0;
}
.marketing p + h4 {
	margin-top: 28px;
}
#main {
	background-color: #FFF;
	margin: 0 auto;
	max-width: 990px;
	max-height: auto;
}
#site-logo a {
	display: block;
	width: 242px;
	height: 43px;
	text-indent: -9999em;
	background: transparent url(logo_horizontal.png) scroll no-repeat 0 0;
}
 @media (min-width: 981px) {
body {
	padding-top: 0;
}
}
.navbar-inner {
	-webkit-border-radius: 0;
	-moz-border-radius: 0;
	border-radius: 0;
}
.navbar-inverse .navbar-inner {
	background-color: #990000;
	background-image: -moz-linear-gradient(top, #990000, #990000);
	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#990000), to(#990000));
	background-image: -webkit-linear-gradient(top, #990000, #990000);
	background-image: -o-linear-gradient(top, #990000, #990000);
	background-image: linear-gradient(to bottom, #990000, #990000);
	background-repeat: repeat-x;
	border-color: #990000;
 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#990000', endColorstr='#990000', GradientType=0);
}
.navbar-inverse-sgi .brand, .navbar-inverse-sgi .nav > li > a {
	color: #fff;
	text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.navbar .nav > li > a:focus, .navbar .nav > li > a:hover {
	color: #fff;
	text-shadow: #183864 0 3px 6px;
	border: 0;
	outline: 0;
	cursor: pointer
}
.navbar .nav > .active > a, .navbar .nav > .active > a:hover, .navbar .nav > .active > a:focus {
	color: #fff;
	background-color: #990000;
	font-size: 1.6em;
	text-shadow: #142f55 0 2px 5px;
	-webkit-box-shadow: inset 0 4px 8px #1e467e;
	box-shadow: inset 0 4px 8px #990000;
	border: 1px solid #990000;
	border-bottom: 0;
	border-top: 0;
}
.navbar .nav li.dropdown.open > .dropdown-toggle, .navbar .nav li.dropdown.active > .dropdown-toggle, .navbar .nav li.dropdown.open.active > .dropdown-toggle {
	color: #fff;
	background-color: #990000;
}
.navbar-inverse .brand, .navbar-inverse .nav > li > a {
	color: rgb(255, 255, 255);
	text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.nav-pills > .active > a, .nav-pills > .active > a:hover {
	color: #ffffff;
	background-color: #990000;
}
.nav-pills > .active > a, .nav-pills > .active > a:hover {
	color: #ffffff;
	background-color: #990000;
}
footer {
	background-color: #990000;
	border-top: 1px solid #872119;
	color: #ddb3b0;
	text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
	margin-top: 60px;
	padding-top: 45px;
	padding-bottom: 30px;
	padding: 5px;
}
a {
	color: #990000;
}
a:hover {
	color: #990000;
	text-decoration: underline;
}
footer a {
	color: #fff;
}
footer a:hover {
	color: #ddb3b0;
	text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
	text-decoration: underline;
}
</style>
<link href="../bootstrap/css/bootstrap-responsive.css" rel="stylesheet"></link>
<link rel="stylesheet" href="../bootstrap/FortAwesome-Font-Awesome-13d5dd3/css/font-awesome.min.css"></link>

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-144-precomposed.png"></link>
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-114-precomposed.png"></link>
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-72-precomposed.png"></link>
<link rel="apple-touch-icon-precomposed" href="http://twitter.github.com/bootstrap/assets/ico/apple-touch-icon-57-precomposed.png"></link>
<link rel="shortcut icon" href="http://twitter.github.com/bootstrap/assets/ico/favicon.png"></link>
</h:head>

<h:body class="theme-shellstage" >
<div id="main" style="padding:10px;">
  <div class="container-narrow">
    <div class="masthead">
      <ul class="nav nav-pills pull-right">
        <li>
          <form class="form-search" style="margin: 0 0 0;">
            <div class="input-append">
              <input type="text" class="span2 search-query"></input>
              <button type="submit" class="btn btn-danger">Buscar</button>
            </div>
          </form>
        </li>
      </ul>
      <ul class="nav nav-pills pull-right">
        <li class="active"><a href="#">Principal</a></li>
        <li><a href="usuario/crud.jsf">Admin</a></li>

      </ul>
      <h3 class="muted">
        <h1 id="site-logo"><a href="http://www.inthemix.com.au/">inthemix.com.au: australian dance music | news | reviews | photos | forums | chat | what's on</a></h1>
      </h3>
    </div>
    
    <div class="navbar navbar-inverse">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
          <a class="brand" href="./index.html">Academia</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class=""> <a href="./index.html">Serviços</a> </li>
              <li class="active"> <a href="./components.html">Cross Fit</a> </li>
              <li class=""> <a href="./getting-started.html">Saúde</a> </li>
              <li class=""> <a href="./scaffolding.html">Esporte</a> </li>
              <li class=""> <a href="./javascript.html">Localização<i class="icon-bolt"></i></a> </li>
              <li class=""> <a href="./customize.html">Contato</a> </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    
    <div class="">
    	<div class="row-fluid">
        	<div class="span12">
          		<h:panelGroup rendered="#{UsuarioMB.modoListar}">
				<h:messages id="messages" globalOnly="true"
                style="border: 1px solid #999999;background-color:#ffffee;padding:6px;font-weight:bold"
                errorStyle="color:#ff0000;font-weight:bold" layout="table"/>
                
				<h:form>
					<p:commandButton action="#{UsuarioMB.criar}" value="Novo" ajax="false"></p:commandButton>
					<p></p>
						
					<p:dataTable 
						value="#{UsuarioMB.lista}" 
						var="obj" 
						selectionMode="single" 
						selection="#{UsuarioMB.entidade}"
						paginator="true"
						rows="10"
						rowKey="#{obj.id}"
						widgetVar="tabela">
							

						<p:column>
					    	<f:facet name="header">
					       		<h:outputText value="Nome" />
					       	</f:facet>
					           <h:outputText value="#{obj.nome}" />
					    </p:column>
					    
					    <p:column>
					    	<f:facet name="header">
					       		<h:outputText value="Editar" />
					       	</f:facet>
					           <p:commandButton value="Editar" action="#{UsuarioMB.editar(obj)}" ajax="false"></p:commandButton>
					    </p:column>
					</p:dataTable>
				</h:form>
			</h:panelGroup>
			
			<h:panelGroup rendered="#{UsuarioMB.modoEditar}">
				<h:form styleClass="form-horizontal">
					
					<p:messages id="mensagens"></p:messages>	
						
					<fieldset>
						<legend>Cadastro de Usuários</legend>
					
						<div class="control-group">	
							<h:outputLabel value="Nome:" for="nome" styleClass="control-label"/>
							<p:inputText id="nome" value="#{UsuarioMB.entidade.nome}" maxlength="20"/>
						</div>
						
						<div class="control-group">	
							<h:outputLabel value="Senha:" for="senha" styleClass="control-label"/>
							<p:password id="senha" value="#{UsuarioMB.entidade.senha}" maxlength="20"/>
						</div>
							
						<div class="control-group">	
							<h:outputLabel value="E-mail:" for="email" styleClass="control-label"/>
							<p:inputText id="email" value="#{UsuarioMB.entidade.email}" maxlength="100"/>
						</div>
							
						<div class="control-group">
							<p:commandButton 
								value="Gravar" 
								action="#{UsuarioMB.gravar}"
								ajax="false"
								update="mensagens"/>
								
							<p:commandButton 
								value="Voltar" 
								action="#{UsuarioMB.voltar}"
								ajax="false"
								immediate="true"
								update="mensagens"/>
							
							<p:commandButton 
								value="Excluir" 
								action="#{UsuarioMB.excluir}"
								rendered="#{UsuarioMB.exibirExcluir}"
								onclick="confirmation.show()" 
								ajax="false"
								type="button"/>
								
							<p:confirmDialog 
								id="confirmDialog" 
								message="Confimar a exclusão do registro?"  
						    	header="Confirmação!" 
						    	severity="alert" 
						    	widgetVar="confirmation">  
						                  
								<p:commandButton 
						   			id="confirm" 
						   			value="Sim" 
						   			oncomplete="confirmation.hide()"  
						    		action="#{UsuarioMB.excluir}"
	   								ajax="false"/>  
						        
								<p:commandButton 
						  			id="decline" 
						   			value="Não" 
						   			onclick="confirmation.hide()" 
						   			type="button" />   
						                  
							</p:confirmDialog>
						</div>
					</fieldset>
				</h:form>
			</h:panelGroup>
        	</div>
       </div>
     </div>
	</div>
    
</div>
<!-- /container --> 

<!-- Le javascript
    ================================================== --> 
<!-- Placed at the end of the document so the pages load faster --> 
<script src="http://servicos.sgi.ms.gov.br/templates/bootstrap-sgi/bootstrap/js/jquery.js"></script> 
<script src="http://servicos.sgi.ms.gov.br/templates/bootstrap-sgi/bootstrap/js/bootstrap.js"></script> 
<script type="text/javascript" src="http://servicos.sgi.ms.gov.br/templates/bootstrap-sgi/bootstrap/js/prettify.js"></script>
</h:body>
</html>
